/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.comut.crud.pojo.poi;

import java.io.Serializable;
import java.util.LinkedHashMap;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author asantos
 */
@XmlRootElement( )
@XmlAccessorType(XmlAccessType.FIELD)
public class Poi implements Serializable{
    
    private static final long serialVersionUID = 123234;
    
    private int id = -1;
    
    private int id_category;
    private String id_user = null;
    private String id_group = null;
    private String id_external = null;
    private String id_image = null;
    private String latitude = null;
    private String longitude = null;
    private String radius = null;
    private String alias = null;
    private String validated = null;
    private String description = null;
    private String max_auth_stop_time = null;
    private LinkedHashMap metadata = null;
    
    private String parameters = null;

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getId_category() {
        return id_category;
    }

    public void setId_category(int id_category) {
        this.id_category = id_category;
    }

    public String getId_external() {
        return id_external;
    }

    public void setId_external(String id_external) {
        this.id_external = id_external;
    }

    public String getId_group() {
        return id_group;
    }

    public void setId_group(String id_group) {
        this.id_group = id_group;
    }

    public String getId_image() {
        return id_image;
    }

    public void setId_image(String id_image) {
        this.id_image = id_image;
    }

    public String getId_user() {
        return id_user;
    }

    public void setId_user(String id_user) {
        this.id_user = id_user;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getMax_auth_stop_time() {
        return max_auth_stop_time;
    }

    public void setMax_auth_stop_time(String max_auth_stop_time) {
        this.max_auth_stop_time = max_auth_stop_time;
    }

    public LinkedHashMap getMetadata() {
        return metadata;
    }

    public void setMetadata(LinkedHashMap metadata) {
        this.metadata = metadata;
    }

    public String getRadius() {
        return radius;
    }

    public void setRadius(String radius) {
        this.radius = radius;
    }

    public String getValidated() {
        return validated;
    }

    public void setValidated(String validated) {
        this.validated = validated;
    }

    public String getParameters() {
        return parameters;
    }

    public void setParameters(String parameters) {
        this.parameters = parameters;
    }
    
    
    @Override
    public String toString() {
        return "Poi{" + "id=" + id + ", id_category=" + id_category + ", id_user=" + id_user + ", id_group=" + id_group + ", id_external=" + id_external 
                + ", id_image=" + id_image + ", latitude=" + latitude + ", longitude=" + longitude + ", radius=" + radius 
                + ", alias=" + alias + ", validated=" + validated + ", description=" + description + ", max_auth_stop_time=" + max_auth_stop_time 
                + ", metadata=" + metadata + ", parameters=" + parameters + '}';
    }
    
    public boolean isValid() {
        if(id_category<1 || id_user==null || id_user.equals("")|| id_group==null || id_group.equals("")|| id_image==null || id_image.equals("")|| 
           latitude==null || latitude.equals("") || longitude==null || longitude.equals("") || radius==null || radius.equals("") ||
           alias==null || alias.equals("") || validated==null || validated.equals("") || description==null || description.equals("") ||   
           max_auth_stop_time==null || max_auth_stop_time.equals("") || parameters!=null)
            return false;
        
        return true;
    }
    
    public boolean updateXml(){
        if(description!=null ||max_auth_stop_time!=null || metadata!=null)
            return true;
        return false;
    }
    
    public boolean updatePoiCategory(){
        if(id_group !=null)
            return true;
        return false;
    }
    
    

    
}
